<?php
/**
 * Filename: RemoteControl.php
 * 功能: 简单的控制示例
 */

/**
 * 简单的控制类
 *
 */
class RemoteControl {
	/**
	 * 命令对象
	 * @var Command
	 */
	private $slot;
	//private $onCommand;
	//private $offCommand;
	
	/**
	 * 初始化
	 */
	public function __construct() {
		//$this->onCommand = array();
		//$this->offCommand = array();
	} //END func __construct
	
	/**
	 * 设置命令
	 *
	 * @param Command $command
	 */
	public function setCommand(Command $command) {
		$this->slot = $command;
	} //END func setCommand
	
	/**
	 * 按钮被按下
	 * 执行命令
	 */
	public function buttonWasPressed() {
		$this->slot->execute();
	} //END func buttonWasPressed
	
} //END class RemoteControl
?>